import 'package:flutter/material.dart';
import 'package:memo/pages/history_todo_list_page.dart';
import 'package:memo/pages/setting_page.dart';
import 'package:memo/pages/work_record_list_page.dart';
import 'package:memo/state/click_state.dart';
import 'package:memo/state/work_record_list_state.dart';
import 'package:provider/provider.dart';

import 'package:flutter_localizations/flutter_localizations.dart';
import 'pages/home_page.dart';
import 'state/work_record_state.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(builder: (_) => WorkRecordState()),
        ChangeNotifierProvider(builder: (_) => ClickState()),
        ChangeNotifierProvider(builder: (_) => WorkRecordListState()),
      ],
      child: MaterialApp(
        locale: Locale('zh', 'CN'),
        localizationsDelegates: [
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
        ],
        supportedLocales: [
          Locale('zh', 'CN'),
        ],
        routes: {
          "/workRecordListPage" : (context) => WorkRecordListPage(),
          "/settingPage" : (context) => SettingPage(),
          "/historyTodoListPage" : (context) => HistoryTodoListPage(),
        },
        title: 'Flutter Demo',
        theme: ThemeData.dark(),
        home: HomePage(),
      ),
    );
  }
}

